package com.zl.pro.service;


import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.cloud.openfeign.FeignClient;


import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.github.pagehelper.PageInfo;
import com.zl.pro.pojo.Collect;
import com.zl.pro.pojo.FundCompany;
import com.zl.pro.pojo.FundDetails;
import com.zl.pro.pojo.FundManager;

@Component
@FeignClient(value = "FUND-MESSAGE-PROVIDER")
public interface FundDetailsService {
//查询基金
	@RequestMapping("/funddetails/allfund")
	public PageInfo<FundDetails> findFundDetails(@RequestParam(defaultValue = "1",value = "fund") String fund,@RequestParam(defaultValue = "1",value = "pageNum") Integer pageNum,@RequestParam(defaultValue = "10",value = "pageSize") Integer pageSize);

//查询经理
	@RequestMapping("/funddetails/allmanager")
	public PageInfo<FundManager> findAllManager(@RequestParam(defaultValue = "1",value = "manager") String manager,@RequestParam(defaultValue = "1",value = "pageNum") Integer pageNum,@RequestParam(defaultValue = "10",value = "pageSize") Integer pageSize);

//查询公司
	@RequestMapping("/funddetails/allcompany")
	public PageInfo<FundCompany> findAllCompany(@RequestParam(defaultValue = "1",value = "company") String company,@RequestParam(defaultValue = "1",value = "pageNum") Integer pageNum,@RequestParam(defaultValue = "10",value = "pageSize") Integer pageSize);

//查询单个基金
	@RequestMapping(value="/funddetails/findone",method=RequestMethod.GET)
	public FundDetails findOne(@RequestParam(value = "fundDetailsId") Long fundDetailsId);

//插入一个基金
	@RequestMapping(value="/funddetails/insertone",method=RequestMethod.GET)
	public Integer insertOne(@RequestBody FundDetails fundDetails);
		
//根据基金超市分类查询
	@RequestMapping(value="/funddetails/findbytype",method=RequestMethod.GET)
	public PageInfo<FundDetails> findByType(@RequestParam(value = "fundType") String fundType,@RequestParam(defaultValue = "1",value = "pageNum") Integer pageNum);

//收藏一个基金
	@RequestMapping(value="/collect/insertone",method=RequestMethod.GET)
	public Integer insertOne(HttpServletRequest request,@RequestParam(value="funddetailsid") Long funddetailsid);
	
//通过用户id查询用户的收藏基金
	@RequestMapping(value="/collect/findall",method=RequestMethod.GET)
	public List<Collect> findAll(HttpServletRequest request);
}